﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace ATM_Group3.Data
{
    public class Log:Connection
    {
       //private  Card _card;
       private  int _logID;
       private float _amount;
       private String _details;
      // private LogType _logType;

       public String DETAILS
       {
           get { return _details; }
           set { _details = value; }
       }
       public int LOGID
       {
           get { return _logID; }
           set { _logID = value; }
       }
       public float AMOUNT
       {
           get { return _amount; }
           set { _amount = value; }
       }


       public void WriteLog(Log obj, Card card, LogType logType)
       {
           SqlCommand cmd = new SqlCommand("Log_Write", conn);
           cmd.CommandType = CommandType.StoredProcedure;
          // cmd.Parameters.Add(new SqlParameter("@p1", obj.LOGID));
           cmd.Parameters.Add(new SqlParameter("@p2", obj.AMOUNT));
           cmd.Parameters.Add(new SqlParameter("@p3", obj.DETAILS));
           cmd.Parameters.Add(new SqlParameter("@p4", card.CARDID));
           cmd.Parameters.Add(new SqlParameter("@p5", logType.LOGTYPEID));
       }
    }
}